﻿@{
    ViewBag.Title = "TriggerEventByCode";
    Layout = "~/Views/Shared/_Page.cshtml";
}

<h2>Trigger Event By Code</h2>

Name: <input id="txtName" class="inputbox" type="text"><br /><br />

<button id="btnChangeNameTriggerEvent">Change Name & Trigger Event</button>

<script type="text/javascript">
    $(document).ready(function () {
        $("#txtName").on("change", function () {
            ZEUS.DEBUG.log("Name is changed to: " + $("#txtName").val());
        });

        $("#btnChangeNameTriggerEvent").click(function () {
            $("#txtName").val("Jane Smith");
            $("#txtName").trigger("change");
        });
    });
</script>

